package cc.flyflow.core.utils;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.lang.Dict;
import cn.hutool.extra.spring.SpringUtil;
import cc.flyflow.core.cmd.ExpressCmd;
import org.flowable.engine.ManagementService;

/**
 * 数据 工具
 *
 * @author Huijun Zhao;Jyl
 * @date 2023-08-21 17:03
 */
public class DataUtil
{

    /**
     * 表达式
     */
    public static boolean expression(String symbol, Dict value)
    {
        ManagementService managementService = SpringUtil.getBean(ManagementService.class);
        Object result = managementService.executeCommand(new ExpressCmd(symbol, value));
        return Convert.toBool(result);
    }
}
